package org.suburban.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.xmpp.PresenceShow;
import com.google.appengine.api.xmpp.PresenceType;

/**
 * Servlet to send presence message to the client
 * @author Alexey Palamarchuk (slonnik@gmail.com)
 *
 */
@SuppressWarnings("serial")
public class PresenceServlet extends ClientServlet{

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
			/** call super class method*/
			super.doPost(req, resp);
			
			/** send presence message*/
			xmpp.sendPresence(originator, PresenceType.AVAILABLE,
					PresenceShow.CHAT, "Ready to chat", client);
	}
	
}
